﻿@using Models;
@model expert
@{
    ViewBag.Title = "添加专家";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
<section>
    <div class="container">
        <div class="breadcrumb">
            <ul>
                <li>
                    <a href="/admin/Account/Index">
                        <span class="fa fa-home"></span>
                        <span>返回主菜单&nbsp;&gt;&nbsp;</span>
                    </a>
                </li>
                <li>
                    <a href="/admin/expert/index">
                        <span>专家管理&nbsp;&gt;&nbsp;</span>
                    </a>
                </li>
                <li>
                    <a href="javascript:void(0);">
                        <span class="active-b">添加专家</span>
                    </a>
                </li>
            </ul>
        </div>
        <form method="post" action="/admin/expert/create" class="formvalidator" autocomplete="off">
            <div class="wrap">
                @Html.HiddenFor(o => o.id)
                <div class="form-group">
                    <label class="col-xs-2">专家姓名：</label>
                    <div class="col-xs-6">
                        @Html.TextBoxFor(o => o.name, new { type = "text", placeholder = "专家姓名", @class = "validate[required]" })
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2">手机号码：</label>
                    <div class="col-xs-6">
                        @Html.TextBoxFor(o => o.mobile, new { type = "text", placeholder = "专家手机号码", @class = "validate[required,custom[mobile]]" })
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2">专家职称：</label>
                    <div class="col-xs-6">
                        @Html.TextBoxFor(o => o.position, new { type = "text", placeholder = "专家职称，如：教授、主任等"})
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2">专家头像：</label>
                    @Html.HiddenFor(o => o.avatar)
                    <div class="col-xs-10">
                        <span class="uploadimage" id="uploadavatar" data-btn="#uploadavatar_btn" data-value="#avatar" data-img="#property-avatar"></span>
                        <a id="uploadavatar_btn" class="btn btn-primary">
                            <i class="fa fa-upload"></i>上传图片
                        </a>  推荐大小（200px * 200px）
                        <br />
                        <img id="property-avatar" src="@Model.avatar" width="200" />
                    </div>
                </div>
            </div>
            <ul class="big-btn">
                <li>
                    <input type="button" class="button active" value="保存" onclick="ajaxSubmit(this, false)" data-successcallback="successcallback">
                </li>
                <li>
                    <input type="button" class="button" value="取消" onclick="window.history.go(-1);">
                </li>
            </ul>
        </form>
    </div>
</section>
<script>
    function successcallback(data) {
        var d = data.data;
        window.location.href = '/admin/expert/index';
    }
</script>